package so.sao.code.service.infrastructure.jpa.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.TAG_SCRAP_TYPE;

@Converter(autoApply = true)
public class TagScrapTypeConvert implements AttributeConverter<TAG_SCRAP_TYPE, Integer> {
	@Override
	public Integer convertToDatabaseColumn(TAG_SCRAP_TYPE attribute) {
	    return attribute.getValue();
	}

	@Override
	public TAG_SCRAP_TYPE convertToEntityAttribute(Integer dbData) {
		return TAG_SCRAP_TYPE.fromValue(dbData);
	}

	 
}
